#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time          : 2023/3/3 16:46
# File          : time_of_set.py
# @Author       : MingTai
# @Department   : platform_qa
import datetime
import time


def get_date():
    beforeOfmin = 20
    beforeOfmin1 = 40
    today = datetime.datetime.now()
    print(today)  # 计算偏移量
    offset = datetime.timedelta(minutes=-beforeOfmin)  # 计算前20分钟偏移量
    time_str = (today + offset).strftime("%Y-%m-%d %H:%M:00")
    timeArray = time.mktime(time.strptime(time_str, '%Y-%m-%d %H:%M:00'))
    end_uid = int(timeArray + 1) * 1000 - 1

    offset1 = datetime.timedelta(minutes=-beforeOfmin1)  # 计算前40分钟偏移量
    time_str1 = (today + offset1).strftime("%Y-%m-%d %H:%M:00")
    timeArray1 = time.mktime(time.strptime(time_str1, '%Y-%m-%d %H:%M:00'))
    start_uid = int(timeArray1) * 1000

    dd = (today + offset1).strftime('%Y_%m')
    return start_uid, end_uid, dd


def test_param(a=1, b=2):
    return a + b


if __name__ == '__main__':
    print(test_param(a=2, b=3))
